package Array;

import java.util.Arrays;

public class StringToDoubleArray {
    public static void main(String[] args) {
        String str = "60,120,30,90,180";
        String[] strArray = str.split(",");
        double[] doubleArray = new double[strArray.length];
        for (int i = 0; i < strArray.length; i++) {
            doubleArray[i] = Double.parseDouble(strArray[i]);
        }
        Arrays.sort(doubleArray);
        System.out.println("排序后的数组：");
        for (double num : doubleArray) {
            System.out.print(num + " ");
        }
        System.out.println();
        double firstElement = doubleArray[0];
        double sinValue = Math.sin(Math.toRadians(firstElement));
        System.out.println("数组第一个元素 " + firstElement + " 度的 sin 值为：" + sinValue);
    }
}